<template>
  <div class="content">
    <div class="detail">
      <div class="head"><span>意见详情</span></div>
      <div class="info">
        <table>
          <tr>
            <td>反馈日期 :</td>
            <td>{{ info.lastTime?setLocalTime(info.lastTime):info.lastTime }}</td>
          </tr>
          <tr>
            <td>意见类型 :</td>
            <td>{{info.adviseType}}</td>
          </tr>

          <tr>
            <td>反馈人 :</td>
            <td>{{info.userName}}</td>
          </tr>
          <tr>
            <td>手机号 :</td>
            <td>{{info.userPhone}}</td>
          </tr>
          <tr>
            <td class="desc">描述 :</td>
            <td>{{info.adviseContent}}</td>
          </tr>
          <tr>
            <td>照片 :</td>
            <td><div class="pic">
              {{info.adviseImg}}</div></td>
          </tr>
        </table>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      // id: this.$route.params.id
    }
  },
  computed: {
    id () {
      return Number(sessionStorage.getItem('id'))
    },
    info () {
      // return this.$store.state.userManage.tableData.filter(item => item.id === this.id)[0]
      return this.$store.state.userManage.tableData
    }
  },
  created () {
    const phone = sessionStorage.getItem('id')
    this.$store.dispatch('userManage/getAdviseData', phone).catch(err => {
      this.$message({
        type: 'error',
        message: err,
        duration: 1000
      })
    })
  },
  methods: {
    setLocalTime (time) {
      return this.$moment(+new Date(time)).format('YYYY-MM-DD HH:mm:ss')
    }
  }
}
</script>

<style lang="scss" scoped>
.content {
  .detail {
    min-height: 932px;
    box-sizing: border-box;
    background: #ffffff;
    border-radius: 8px;
    // margin-top: 24px;
    padding: 0 24px;
  }
  .head {
    width: 100%;
    height: 78px;
    border-bottom: 1px solid #e6e9f0;
    position: relative;
    font-size: 16px;
    font-weight: 500;
    color: #1b1f35;
    span {
      position: absolute;
      bottom: 20px;
    }
  }
  .info {
    margin-top: 53px;
    margin-left: 20px;
    tr {
      color: #3d4966;
      vertical-align: top;
      td:nth-child(1) {
        width: 76px;
        height: 50px;
        color: #1b1f35;
        text-align: right;
      }
      td:nth-child(2) {
        padding-left: 20px;
      }
    }
  }
  .pic {
    width: 120px;
    height: 120px;
    opacity: 0.6;
    border: 1px solid #c6ccd7;
    border-radius: 5px;
  }
}
</style>
